package com.jt.aop;

import com.jt.vo.SysResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice//该注解只拦截controller层抛出的异常信息
public class SystemAOP {
    //当前controller层，只拦截运行时异常
    @ExceptionHandler(RuntimeException.class)
    public SysResult exception(Exception e){
        e.printStackTrace();
        return SysResult.fail();
    }
}
